import java.util.Objects;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-11-05
 * Time: 18:44
 */
class Person {
    public String id;

    public Person(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id='" + id + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Person person = (Person) o;
        return Objects.equals(id, person.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class Testnew {
    public static void main(String[] args) {
        Person person1 = new Person("1");
        Person person2 = new Person("22");
        Person person3 = new Person("3");
        Person person4 = new Person("4");
        Person person5 = new Person("56");
        Person person6 = new Person("6");
        Person person7 = new Person("7");
        Person person8 = new Person("999");

//        System.out.println(person1.hashCode());
//        System.out.println(person2.hashCode());

        newHashBucket<Person, String> newHashBucket = new newHashBucket<>();

        newHashBucket.put(person1, "张兆涵1");
        newHashBucket.put(person2, "李智璇2");
        newHashBucket.put(person3, "张兆涵3");
        newHashBucket.put(person4, "张兆涵4");
        newHashBucket.put(person5, "张兆涵5");
        newHashBucket.put(person6, "张兆涵6");
        newHashBucket.put(person7, "张兆涵7");
        newHashBucket.put(person8, "张兆涵8");
        System.out.println(newHashBucket.getValue(person1));
        System.out.println(newHashBucket.getValue(person2));
        System.out.println(newHashBucket.getValue(person3));
        System.out.println(newHashBucket.getValue(person4));
        System.out.println(newHashBucket.getValue(person5));
        System.out.println(newHashBucket.getValue(person6));
        System.out.println(newHashBucket.getValue(person7));
        System.out.println(newHashBucket.getValue(person8));
        System.out.println("sdf");
        //System.out.println(newHashBucket.getValue(person9));
    }
}
